import type { RequestMethod } from '@/types/handle'
import type { ButtonType } from 'element-plus'

export function getType(val: RequestMethod): ButtonType {
  if (val == 'GET') {
    return 'success'
  } else if (val == 'POST') {
    return 'warning'
  } else if (val == 'DELETE') {
    return 'danger'
  } else if (val == 'PUT') {
    return 'primary'
  }
  return 'default'
}
